<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>武汉市中联众鑫建筑机械有限公司</title>
<meta name="keywords" content="塔式起重机出租，施工升降机出租，建筑设备出，武汉市中联众鑫建筑机械有限公司">
<meta name="description" content="武汉市中联众鑫建筑机械有限公司成立于2012年12月25日。承接各类塔式起重机、施工升降机租赁、安装、维修、售后服务一家专业提供塔吊、施工电梯的安装拆卸 、维修、售后服务、等建筑机械设备租赁、零配件供应的服务企业">
<link rel="stylesheet" media="all" type="text/css" href="index.css" />
<style type="text/css">
.paging {
	text-align : right;
	padding-right : 5px;
	padding-top : 5px;
	padding-bottom : 5px;
}
.paging span {
	padding-left : 5px;
	padding-right : 5px;
	padding-top : 3px;
	padding-bottom : 3px;
	border : 1px solid #DEDEDE;
}
</style>
</head>

<body>
<?php include 'top.php';
		include 'business/dao/BaseDataAccess.php';
		include 'business/dao/NewsAccess.php';
		include 'business/model/model.php';
		ini_set('display_errors',1);
		date_default_timezone_set("Asia/Shanghai");
		
		if (isset($_GET["pageNo"])) {
			$pageNo = $_GET["pageNo"];
		} else {
			$pageNo = 1;
		}
		$newsDao = new NewsDao();
		$page = new Page();
		$page->setPageSize(10);
		$page->setPageNo($pageNo);
		$newsDao->getNews($page);
		$data = $page->getData();
		?>

<!--center-->
<div class="box centent">
	<?php include 'left.php'; ?>
		<div class="right">
			<div class="center">
				<dl><h1>最新动态</h1></dl>
				<ul>
					<?php 
					for ($i = 0; $i < count($data); $i++) {
						$new = $data[$i]
					?>
						<li style="text-align: left;padding-left: 5px;padding-right: 5px;">
							<span>·</span>
							<span><a href="show_new.php?id=<?php echo $new->getId()?>"><?php echo $new->getTitle()?></a></span>
							<div style="margin-top:3px;margin-bottom:4px;height:1px;background-image: url(images/line.jpg)"></div>
						</li>
					<?php
					}
					?>
					<li>
						<div class="paging">
							<span><?php echo $page->getPageNo()."/".$page->getPageCount()?></span>
							<span>首页</span>
							<span>上页</span>
							<?php
							for ($i = 1; $i <= $page->getPageCount(); $i++) {
								if ($i == $page->getPageNo()) {
							?>
									<span style="color:red;font-weight:bold;"><?php echo $i?></span>
							<?php
								} else {
							?>
									<span><a href="news.php?pageNo=<?php echo $i?>"><?php echo $i?></a></span>
							<?php
								}
							} 
							?>
							<span>下页</span>
							<span>尾页</span>
						</div>
					</li>
				</ul>
			</div>
		</div>
</div>
		
		
<?php include 'bottom.php';?>
</body>
</html>